Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the router to get the correct path from the connect facebook check route #96

Merged
merged 2 commits into from
Apr 20, 2018

Conversation

alexander-schranz
Copy link
Contributor

Prevent problems like: #39

README.md Outdated
@@ -266,7 +266,7 @@ class MyFacebookAuthenticator extends SocialAuthenticator
public function supports(Request $request)
{
// continue ONLY if the URL matches the check URL
return $request->getPathInfo() == '/connect/facebook/check';
return $request->getPathInfo() == $this->router->getRouteCollection()->get('connect_facebook_check')->getPath();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't just $this->router->generate('connect_facebook_check')?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would add a host when the route has a host defined or?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't add a host, but I'm actually not sure if you have the host defined - good point :).

But, there another option anyways, where we look specifically at the route name:

return $request->attributes->get('_route') == 'connect_facebook_check';

Do you guys like that better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me did update the PR

Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@weaverryan weaverryan merged commit 62e808c into knpuniversity:master Apr 20, 2018
@weaverryan
Copy link
Member

Thank you!

@alexander-schranz alexander-schranz deleted the patch-1 branch April 20, 2018 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants